//
//  ViewController.m
//  NavTest
//
//  Created by pier on 12-4-12.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"
#import "SecondView.h"

@implementation ViewController

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
	[super viewWillDisappear:animated];
}

- (void)viewDidDisappear:(BOOL)animated
{
	[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

- (IBAction)pushOneView {
	SecondView *sv = [[[SecondView alloc] initWithNibName:@"SecondView" bundle:nil] autorelease];
    [self.navigationController pushViewController:sv animated:YES];
}

- (IBAction)modelShow:(id)sender {
	SecondView *sv =[[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
    [self presentModalViewController:sv animated:YES];
}

- (IBAction)SubView:(id)sender {
	SecondView *sv =[[SecondView alloc] initWithNibName:@"SecondView" bundle:nil];
	AppDelegate *dg = (AppDelegate *)[UIApplication sharedApplication].delegate;
	[dg changeSubView:my show:sv];
}


@end
